$upnppath = 'HKLM:\System\CurrentControlSet\Enum\SWD\DAFUPnPProvider'
$upnpdevices = Get-ChildItem $upnppath | Get-ItemProperty -name 'FriendlyName'
 
foreach ($upnpdevice in $upnpdevices) {
	if ($upnpdevice.'FriendlyName' -ne 'I wont be deleted') {
		$name =  $upnpdevice.PSChildName
		echo "Deleting $name"
		pnputil /remove-device "SWD\DAFUPnPProvider\$name"
	}
}